#include "cw32_hal_rtc.h"


void cw32_hal_rtc_set_alarm(uint32_t alarm_x,RTC_AlarmTypeDef* RTC_AlarmStruct)
{
#if (RTC_ENABLE == 1)
    RTC_SetAlarm(alarm_x, RTC_AlarmStruct);
    RTC_AlarmCmd(alarm_x, ENABLE);
	
	if(alarm_x == RTC_IT_ALARMA)
	{	
		RTC_ITConfig(RTC_IT_ALARMA, ENABLE);
	}
	else if(alarm_x == RTC_IT_ALARMB)
	{
		RTC_ITConfig(RTC_IT_ALARMB, ENABLE);
	}
#endif
}
